// src/components/article-main.vue
 
import {getArticles} from "@/service/articles"  // 引入
export default {
    data () {
        return {
            articles:[],  // 文章列表
        }
    },
    methods: {
        getArticlesList: function () {  
            getArticles().then(res => {      // 使用，返回数据
                let data = res.data.data.articles;
                this.articles = data;
            })
        }
    },
    created () {
        this.getArticlesList();
    }
}
